package stream;

import java.util.ArrayList;

public class Demo1 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("马斯克");
        list.add("马云");
        list.add("马加爵");
        list.add("库克");
        list.stream().filter(name->name.startsWith("马")).filter(name->name.length() == 3).forEach(name-> System.out.println(name));


    }
}
